﻿using System;
using System.Windows.Forms;
using ebc.message.contract;
using ebc.portal.contract;

namespace ebc.portal {
    public partial class GUI : Form , IPortal{
        public GUI() {
            InitializeComponent();
        }

        private void RequestClick(object sender, EventArgs e) {
            var result = resultDisplay.Text + "=>OutputRequest Portal event OnCoordinator\t<=CoordinatorRequest=>" + Environment.NewLine;
            OnCoordinator.Request(result).Receive(r =>
            {
                resultDisplay.Text = string.Format("{0}=>InputResult Portal\t<=CoordinatorResult=>", r);
            });
        }

        public event Request<string, string> OnCoordinator;
    }
}
